package tw.miku.protocol.codec.gold;

import org.apache.mina.core.buffer.IoBuffer;

import tw.miku.constants.ProtocalConstants;
import tw.miku.protocol.codec.AbstractRequestMessagePack;

public class SetRoadCardRequestPack extends AbstractRequestMessagePack
{

	public int cardType;
	public int x;
	public int y;
	public boolean toggle;

	public SetRoadCardRequestPack(IoBuffer buffer)
	{
		super(buffer);
	}

	@Override
	public void decode()
	{
		super.decode();
		buffer.position(4);
		// isReady = ((buffer.get()) == 0);
		cardType = buffer.getInt();
		x = buffer.getShort();
		y = buffer.getShort();
		toggle = ((buffer.get()) == 0);
	}

	@Override
	public short getTag()
	{
		return ProtocalConstants.SET_ROAD_CARD;
	}

}
